package com.djzz.app.common_util.net;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.djzz.app.common_util.net.bean.ResponseBean;

/**
 * Created by d on 2017/8/30.
 */

public class HttpManager {

    private static RequestQueue queue;
    public static int SOCKET_TIMEOUT = 20000;

    public static void init(Context context){
        queue = Volley.newRequestQueue(context);
        queue.start();
    }

    public static void stopVolleyQueue(){
        queue.stop();
    }

    public static void addQueue(HttpHelper<? extends ResponseBean> helper){

        HttpRequest<? extends ResponseBean>request = helper.getRequest();
        queue.add(request);

    }
}
